﻿using LiveCharts.Wpf;
using LiveCharts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Animation;
using WpfApp001.Core;
using WpfApp001.Model;

namespace WpfApp001.ViewModel
{
    public class HomeVM : NotifyBase
    {
        public HomeVM() {

            List<ChartModel> _chartItems = new List<ChartModel>();

            _chartItems.Add(new ChartModel() {

                StrokeColor = "#FECC71",
                FillColor = "#FFF2DE",
                Values = new LiveCharts.ChartValues<double> { 10, 30, 50, 20, 10, 30 },
                Background = "#EDFAF0",
                Foreground = "#7ADA95",
                CurrentValue = "30%",
                Title = "监控数据"

            });
            _chartItems.Add(new ChartModel() {

                StrokeColor="#FF9999",
                FillColor="#FFCCCC",
                Values=new LiveCharts.ChartValues<double>{ 85,50,68,75,30,56},
                Background="#FFCCCC",
                Foreground="#FF9999",
                CurrentValue="56%",
                Title="内存使用情况"

            });

            _chartItems.Add(new ChartModel()
            {

                StrokeColor = "#668cff",
                FillColor = "#66d9ff",
                Values = new LiveCharts.ChartValues<double> { 3, 20, 50, 34, 30, 24 },
                Background = "#66d9ff",
                Foreground = "#668cff",
                CurrentValue = "24%",
                Title = "Cpu使用情况"

            });

            _chartItems.Add(new ChartModel()
            {

                StrokeColor = "#ff3333",
                FillColor = "#ffb3b3",
                Values = new LiveCharts.ChartValues<double> { 50, 89, 75, 34, 30, 88 },
                Background = "#ffb3b3",
                Foreground = "#ff3333",
                CurrentValue = "88°C",
                Title = "Cpu温度"

            });


            Random random = new Random();
            List<CourseInfo> _CourseInfos = new List<CourseInfo>();
            _CourseInfos.Add(new CourseInfo("C#/.Net构造师蜕变班", new List<CourseInfo.ItemInfo>() {
                new CourseInfo.ItemInfo("云课堂", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("抖音", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("B站", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("博客", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("知乎", "↓", "105%", "Red",random.Next(10, 200))

            }));

            _CourseInfos.Add(new CourseInfo("C#/.Net高级进阶Vip班" , new List<CourseInfo.ItemInfo>() {
                new CourseInfo.ItemInfo("云课堂", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("抖音", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("B站", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("博客", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("知乎", "↓", "105%", "Red",random.Next(10, 200))
            }));

            _CourseInfos.Add(new CourseInfo(".NET架构师体验课", new List<CourseInfo.ItemInfo>() {
               new CourseInfo.ItemInfo("云课堂", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("抖音", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("B站", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("博客", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("知乎", "↓", "105%", "Red",random.Next(10, 200))
            }));

            _CourseInfos.Add(new CourseInfo(".Net架构师蜕变营", new List<CourseInfo.ItemInfo>() {
               new CourseInfo.ItemInfo("云课堂", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("抖音", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("B站", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("博客", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("知乎", "↓", "105%", "Red",random.Next(10, 200))
            }));

            _CourseInfos.Add(new CourseInfo("WPF+上位机+工业互联", new List<CourseInfo.ItemInfo>() {
               new CourseInfo.ItemInfo("云课堂", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("抖音", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("B站", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("博客", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("知乎", "↓", "105%", "Red",random.Next(10, 200))
            }));

            _CourseInfos.Add(new CourseInfo("机器视觉全方向高薪进阶", new List<CourseInfo.ItemInfo>() {
               new CourseInfo.ItemInfo("云课堂", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("抖音", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("B站", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("博客", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("知乎", "↓", "105%", "Red",random.Next(10, 200))
            }));

            _CourseInfos.Add(new CourseInfo("Web前端实战进阶VIP班", new List<CourseInfo.ItemInfo>() {
               new CourseInfo.ItemInfo("云课堂", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("抖音", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("B站", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("博客", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("知乎", "↓", "105%", "Red",random.Next(10, 200))
            }));

            _CourseInfos.Add(new CourseInfo(".Net高级进阶VIP", new List<CourseInfo.ItemInfo>() {
               new CourseInfo.ItemInfo("云课堂", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("抖音", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("B站", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("博客", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("知乎", "↓", "105%", "Red",random.Next(10, 200))
            }));

            _CourseInfos.Add(new CourseInfo("C++和QT跨平台客户端-VIP课程", new List<CourseInfo.ItemInfo>() {
               new CourseInfo.ItemInfo("云课堂", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("抖音", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("B站", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("博客", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("知乎", "↓", "105%", "Red",random.Next(10, 200))
            }));

            _CourseInfos.Add(new CourseInfo("Web前端实战高薪VIP班", new List<CourseInfo.ItemInfo>() {
               new CourseInfo.ItemInfo("云课堂", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("抖音", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("B站", "↓", "105%", "Red",random.Next(10, 200)),
                new CourseInfo.ItemInfo("博客", "↑", "105%", "Green",random.Next(10, 200)),
                new CourseInfo.ItemInfo("知乎", "↓", "105%", "Red",random.Next(10, 200))
            }));



            this.courseInfos = _CourseInfos;

            this.ChartItems = _chartItems;
        }

        private List<string> Groups = new List<string>() { "云课堂","抖音","B站","博客","知乎"};

        private List<ChartModel> chartItems;

		public List<ChartModel> ChartItems
        {
			get { return chartItems; }
			set { chartItems = value; this.DoNotify(); }
		}

        private List<CourseInfo> courseInfos;
        public List<CourseInfo> CourseInfos
        {
            get { return courseInfos; }
            set { courseInfos = value; this.DoNotify(); }
        }
    }
}
